ABOUTDEVELOPERS |
SpatialStream® Code Examples
City Boundaries and Labels
Using SpatialStream® City Boundaries, SLD, and GetMap components, you can access nationwide city boundaries and basic attributes for display in your mapping application. This example will demonstrate how to add city boundaries and city name labels for the entire US (Southern California shown in sample). The SLD (Stylized Layer Descriptor) component allows you to add labels based on attributes in the city boundaries data set and tailor the following display parameters of your city border: boundary color, boundary width, fill color, opacity, label color, and label size. Once the SLD is defined, the GetMap component generates the overlay for your map.
City Boundaries | GetMap | SLD
var city = new Dmp.Layer.WMSLayer("boundary", "SS", {
ignoreHoles: true, antiAlias: true });city.addChild("cityPoly", "DMP_LICENSE/City", "$(ACCOUNT_FOLDER)SLD/SimpleBoundary.sld.xml", { zoomRange: { }); min: 10, max: 19 } city.addChild("cityLabel", "DMP_LICENSE/City", "$(ACCOUNT_FOLDER)SLD/CityLabel.sld.xml", { zoomRange: { }); min: 12, max: 19 } map.addLayer(city); Run Sample View Video Back To Index |